# -*- coding: utf-8 -*-
'''
Created on 2013-4-15

@author: chenkaode@baidu.com
'''
import time,os,sys
import subprocess

class CommonUtil:
    
    @classmethod
    def waitSomeMinutes(self,n):
        time.sleep(60*n)
    
    @classmethod
    def waitSomeSec(self,n):
        time.sleep(n)
        
    @classmethod
    def execWithRet(cls,cmd):
        subp = subprocess.Popen(cmd)
        subp.wait()
        ret = subp.stdout.read()
        return ret
    
    @classmethod
    def execWithoutRet(cls,cmd):
        os.system(cmd)
        
    @classmethod
    def getResPath(self):
        cwp = os.getcwd()
        cwpList =cwp.split(os.sep)
        cwpList.pop()
        return os.sep.join(cwpList) + os.sep + "res"
    
    @classmethod
    def getUbcPkgPath(self):
        return "/data/data/com.baidu.bsf.system"
        
        
        